<?php
/*!
 * LostKids API PHP Library v0.1 
 * http://huali.li/
 *
 * Copyright 2011, 
 * Written By James Pang
 *  
 * Date: 2011/2/14
 */

/**
 * faces repository & recognizer.
 */
interface Recognizer
{
    /** users seeking */
    const SET_SEEKER = 'seeker';
    /** users reported */
    const SET_REPORTER = 'reporter';
    /** users found */
    const SET_FOUND = 'found';
    /** valid users for recognize */
    const SET_VALID = 'valid';

    const ERR_MULTI_FACES = 'multiple_faces_detected';
    /** no match for reporter */
    const ERR_NO_MATCH_REPORTER = 'err_no_match_reporter';
    const ERR_REG_NEED_MORE_IMGS = 'reg_need_more_imgs';

    /**
     * @param string $imgUrls
     * @param enum $set, {'seeker', 'reporter', 'found', 'valid', 'all' },
     *  target users set to search for.
     * @return array[uid=>confidence] array of matching users, with array of confidence
     */
	public function recognize($imgUrls, $set = 'valid');

    /**
     * limit the face to be 1 in the img, else no train
     * 
     * @param string $kidId
     * @param enum $set, put the kid in 'lost' or 'found' set
     * @param string ownerId
     * @param array $imgUrls
     */
	public function train($kidId, $set, $ownerId, $imgUrls);
}
?>
